import React, { Component } from 'react'
import './index.scss'
import { navBarRoutes } from '../../router/routes'
import {withRouter} from 'react-router-dom'
 class Footer extends Component {
  render() {
    const {history,location}=this.props
    return (
      < div className = 'footer' >
         {
        navBarRoutes.map(v=>(
          <div className="footer-item" id={location.pathname===v.path?'active':''} key={v.title}  onClick={()=>{history.push(v.path)}}>
          <span className={v.icon}></span>
        <div className="footer-item-tit">{v.title}</div>
        </div>
        ))
      } 
      </div >
    )
  }
}
export default withRouter(Footer)